/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package shoppinglist;


import javax.swing.JFrame;


import java.awt.*;
import javax.swing.*;



/**
 *
 * @author Student
 */
public class GUI extends JFrame{
    
    ButtonPanel buttonPanel;
    GroceryList dbList;
    ShopPanel shopPanel;
    
    public GUI(Controller controller){
        
        super();
        buttonPanel = new ButtonPanel(controller);
        shopPanel = new ShopPanel();
        dbList = new GroceryList(controller.fetchGroceries());
        setTitle("Shopping List");
        setSize(800, 600);
        setVisible(true);
        setResizable(false);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        BorderLayout border = new BorderLayout();
        setLayout(border);
        add(buttonPanel, BorderLayout.CENTER);
        add(dbList, BorderLayout.WEST);
        add(shopPanel, BorderLayout.EAST);
    }
}
